package com.zero2oneblog.config;

import org.springframework.amqp.core.Exchange;
import org.springframework.amqp.core.ExchangeBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//import java.util.Queue;

@Configuration
public class RabbitMQConfig {

    @Value("${autoDeleteQueue1.name}")
    private String autoDeleteQueue1Name;

    @Bean
    public Queue autoDeleteQueue1() {
        return new Queue(autoDeleteQueue1Name, true);
    }

    @Bean
    public Exchange articleExchange() {
        return ExchangeBuilder.topicExchange("article_exchange").durable(true).build();
    }


}
